Augmented material point method for simulating phase changes and varied materials

ABSTRACT

The disclosure provides an approach for simulating and rendering materials across different states and undergoing phase transitions. In one configuration, a simulation application generates video frames depicting a material phenomenon using an augmented material point method (MPM). Traditional MPM does not handle incompressible materials such as fluids. Techniques disclosed herein augment the MPM with a Chorin-style projection technique to enable simulation of arbitrarily incompressible materials. In one configuration, this is achieved with a marker-and-cell (MAC) grid based MPM solver, a splitting of stress used in the simulation into elastic and dilational parts, a projection-like implicit treatment of the Eulerian evolution of the dilational part of the stress, and particular techniques for rasterizing and updating quantities on the MAC grid. In addition, a heat model may be coupled to the MPM solver, allowing material changes to be driven with temperature and phase changes.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of co-pending U.S. patent application Ser. No. 14/257,044, entitled “Material Point Method for Simulation of Granular Materials” and filed Apr. 21, 2014, which claims benefit of U.S. provisional patent application Ser. No. 61/922,602, filed Dec. 31, 2013. Each of the aforementioned related patent applications is herein incorporated by reference.

BACKGROUND

Field

This disclosure provides techniques for simulating and rendering materials in computer animation.

Description of the Related Art

In computer animation physics engines, “solvers” are used to simulate physical behavior of objects (e.g., the physical response of an object to a collision with another object). These solvers typically employ numerical techniques to approximate the physics so that simulations can be efficiently performed on a computer. Specialized solvers have been used to simulate a variety of phenomena in graphics and computational physics. Such solvers include fluid simulators, rigid body simulators, and cloth simulators, among others, each of which is suited to simulate behavior of a particular type of material. For example, fluid simulators are suited for simulating liquids which deform with no memory, while rigid body simulators are suited for simulating destruction and debris where there is no deformation (e.g., glass shattering).

Such traditional simulators have difficulty simulating materials across different states and undergoing phase transitions, such as ice melting into water, lava solidifying into pāhoehoe, butter melting in a pan, and the like. The difficulty lies in achieving robust, accurate, and efficient simulation of a wide variety of material behaviors without requiring overly complex implementations. Explicit coupling between solid and fluid solvers has been proposed, but such coupling typically requires complex implementation and has significant computation costs.

SUMMARY

This disclosure presents an augmented material point method for simulating phase changes and varied materials. One aspect of this disclosure provides a computer-implemented method which generally includes transferring states of particles representing the material to a grid, and determining an intermediate velocity field using a material point method computation, where the material point method computation discretizes deviatoric forces that affect the material. The method further includes applying a projection over the grid to obtain a projected velocity field from the intermediate velocity field, where the projection discretizes dilational forces that affect the material. In addition, the steps include updating the states of one or more of the particles based on at least the projected velocity field.

Other aspects include, without limitation, a computer-readable medium that includes instructions that enable a processing unit to implement one or more aspects of the disclosed method, as well as a system configured to implement one or more aspects of the disclosed method.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited aspects are attained and can be understood in detail, a more particular description of aspects of the disclosure, briefly summarized above, may be had by reference to the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical aspects of this disclosure and are therefore not to be considered limiting of its scope, for the disclosure may admit to other equally effective aspects.

FIG. 1 illustrates, at a high level, a time step of an augmented material point method for simulating a material across multiple states and phase transitions, according to an aspect of this disclosure.

FIG. 2 illustrates a more detailed flowchart of a method for simulating varied materials and phase transitions, according to an aspect of this disclosure.

FIG. 3 illustrates an example simulation and rendering of a material undergoing phase change.

FIG. 4 illustrates a system in which an aspect of this disclosure may be implemented.

DETAILED DESCRIPTION

This disclosure provides techniques for simulating and rendering materials across different states and undergoing phase transitions. In one configuration, a simulation application generates video frames depicting a material phenomenon using an augmented material point method (MPM). The MPM is a numerical procedure which allows simulations to be performed on a computer, and MPM augments particles used to simulate materials with a transient Eulerian grid for more efficient computing of derivatives and other quantities. While MPM can be used to simulate a wide range of material behaviors, traditional MPM does not handle incompressible materials such as fluids. As a result, traditional MPM cannot simulate materials in both solid and liquid states and the phase change between such states. In contrast, techniques disclosed herein permit such simulations, including simulations of phenomena such as ice melting into water, lava solidifying into pāhoehoe, butter melting in a pan, and the like. In particular, such simulations are made possible by augmenting traditional MPM with a Chorin-style projection technique which enables both simulation of arbitrarily incompressible materials such as fluids and simulation of other materials and behaviors that MPM provides. In one configuration, this is achieved with a marker-and-cell (MAC) grid based MPM solver, a splitting of stress used in the simulation into deviatoric and dilational parts, an MPM treatment of the deviatoric part, a projection-like implicit treatment of the Eulerian evolution of the dilational part, and particular techniques for rasterizing and updating quantities on the MAC grid. In essence, the MPM solver is combined with an incompressible Fluid-Implicit Particle (FLIP) solver in a computationally efficient manner.

FIG. 1 illustrates, at a high level, a time step of an augmented material point method 100 for simulating materials across multiple states and phase transitions, according to an aspect of this disclosure. In each time step, a simulation application updates states of particles, which represent the material, from time t^(n) to time t^(n+1). The simulation application first transfers the particle states, including velocities, to a MAC grid by mass weighted rasterization (inverse mass weighted rasterization for Lamé parameter λ) of properties of the particles at cell centers and faces of the MAC grid, and the simulation application then performs an implicit MPM computation to update the velocities. Here, the MPM is used to discretize deviatoric (i.e., sheer) forces. Further, the simulation application performs a Chorin-style projection to discretize dilational (i.e., mean volumetric or spherical) forces, thereby giving the MPM updated velocities a pressure correction. The Chorin-style projection is used to solve for problematic stresses that would otherwise cause MPM locking when the elastic response is taken to the incompressible limit, and the combination of the implicit MPM computation and the Chorin-style projection results in a MAC-style staggered MPM procedure. It should be understood that a deviatoric/dilational splitting of the constitutive model allows for the MPM and Chorin-style projection to act on different parts of model and synergistically facilitates arbitrary variation of the material from compressible to incompressible. Further, sharp phase transitions benefit from constitutive model splitting since this prevents energy gain when transitioning from fluid to solid. A heat model is also coupled to the MPM solver, allowing material changes to be driven with temperature and phase changes. For example, materials tend to become more liquid-like as temperature rises. To model such an effect, the simulation application may solve a heat equation on the background MPM grid and use the resulting temperature and phase to vary material properties such as Young's modules and Poisson ratio such that the material becomes softer or stiffer, among other things. This additional heat equation solve may be performed at each time step.

Illustratively, the method 100 begins with initial particles 105 at a given time step, and a simulation application rasterizes particle states to a MAC grid at 110 to obtain initial grid velocities. In one configuration, the particle states rasterized to the grid may include values for the properties listed in Table 1. A particular technique for rasterizing particle states to the MAC grid is discussed in greater detail below.

TABLE 1 Notation Description Is Constant x_(p) Position Not constant v_(p) Velocity Not constant m_(p) Mass Constant V_(p) ⁰ Initial volume Constant F_(Ep) Elastic part of F_(P) Not constant F_(Pp) Plastic part of F_(P) Not constant μ_(p) Lamé parameter μ Depends on T_(p) and phase λ_(p) Lamé parameter λ Depends on T_(p) but not phase T_(p) Temperature Not constant U_(p) Transition heat Not constant c_(p) Heat capacity per unit mass Depends on T_(p) and phase k_(p) Heat conductivity Depends on T_(p) and phase L_(p) Latent heat Constant

Phase Depends on T_(p) and U_(p)

At 120, the simulation application performs a deviatoric MPM solve to obtain updated MAC grid velocities 125. As used herein, the mapping from points in an initial material configuration X to their deformed state x is given by x=ϕ(X). Let

$F = \frac{\partial\phi}{\partial X}$ by the Jacobian of such a mapping. Motion of the material is governed by conservation of mass, conservation of momentum, and the elasto-plastic constitutive relation

$\begin{matrix} {{\frac{D\;\rho}{Dt} = 0},{{\rho\frac{Dv}{Dt}} = {{\nabla{\cdot \sigma}} + {\rho\; g}}},{\sigma = {\frac{1}{J}\frac{\partial\Psi}{\partial F_{E}}F_{E}^{T}}},} & (1) \end{matrix}$ where ρ is density, t is time, ν is velocity, σ is the Cauchy stress, g is the gravity, Ψ is the elasto-plastic potential energy density, F_(E) is the elastic part of the deformation gradient F, and J=det(F).

For a realistic simulation of melting and freezing, a suitable treatment of plasticity and a well-behaved constitutive model transition between liquid and solid phases of the material are needed. As used herein, the constitutive model includes physical equation(s) which dictate forces that affect the material during the simulation. The jacobian F discussed above may be separated into an elastic part F_(E) and a plastic part F_(P) so that F=F_(E)F_(P). With this separation, the constitutive model may be derived based on the elasto-plastic fixed co-rotational energy density function Ψ(F_(E))=Ψ_(μ)(F_(E))+Ψ_(λ)(J_(E)), where

${{\Psi_{\mu}\left( F_{E} \right)} = {\mu{{F_{E} - R_{E}}}_{F}^{2}}},{{\Psi_{\lambda}\left( J_{E} \right)} = {\frac{\lambda}{2}\left( {J_{E} - 1} \right)^{2}}},$ and J_(E)=det (F_(E)). This constitutive model Ψ(F_(E)) is known to be suitable for solids, where μ and λ are typically set to the Young's modulus and Poisson's ratio of the material, which are known values. Furthermore, letting μ=0 makes the energy density dependent only on the local volume change and thus is suitable for liquids, both compressible and incompressible (in the λ→∞ limit). In such a case, it can be shown that the Cauchy stress is a scalar pressure. That is, fluids typically try to preserve volume but will deform under shearing stress (rather than resisting such stress like solids do), so when the material melts, the simulation application uses a constitutive model with μ=0 so that there is no longer any shearing stress.

Although experience has shown that disabling the μ term in the energy density function (i.e., setting μ=0) when the material is in the fluid phase is enough to produce compelling results, simply enabling or disabling the μ term is unsuitable for freezing, as this transition results in a sudden large increase in potential energy, which can produce popping artifacts. In order to understand where this energy comes from, consider the dilational

$\left( J_{E} \right)^{\frac{1}{d}}I$ and deviatoric

$\left( J_{E} \right)^{- \frac{1}{d}}F_{E}$ parts of F_(E), where d is the dimension and I is the identity matrix. The first source of energy is from the μ term and is the consequence of the deviatoric component F_(E). The deviatoric part is not used in the Ψ_(λ) and would generally change relatively drastically with the flow. To remedy this, the simulation application may clear the deviatoric component from F_(E) immediately after this component is updated, which corresponds to the fact that fluids are almost perfectly plastic with respect to deviatoric strain. That is, the simulation application lets F_(E)←(J_(E))^(1/d)I at the end of each time step in the fluid phase. Note, this fluid plasticity does not completely eliminate the problem of the sudden increase in potential energy producing artifacts, since the μ term is nonzero even if F_(E) contains only a dilational component. To address this, the dilational component may be eliminated explicitly from the μ component of the constitutive model. This is also done for nearly-incompressible materials and synergistically helps allow for arbitrarily large λ. That is, an alternative energy density function {circumflex over (Ψ)}(F_(E))={circumflex over (Ψ)}_(μ)(F_(E))+Ψ_(λ)(J_(E)) may be used, where {circumflex over (Ψ)}_(μ)(F_(E))=Ψ_(μ)(J_(E) ^(−1/d)F_(E)). The chain rules then gives the deviatoric stress as

$\sigma_{\mu} = {\frac{1}{J}\frac{\partial{\hat{\Psi}}_{\mu}}{\partial F_{E}}\left( F_{E} \right){F_{E}^{T}.}}$

In general, material parameters, e.g., μ and λ, can be defined as functions of the current temperature and the current phase. But experience has shown that keeping such parameters constant with temperature and simply setting the μ term to zero for the fluid state is sufficient to produce visually compelling results.

At 130, the simulation application further performs a cell-centered pressure solve 130 to obtain final MAC grid velocities, which are interpolated and used to update a deformation gradient. To handle nearly incompressible materials, arbitrarily large values of λ may be allowed in the constitutive model. Doing so requires careful treatment of the Ψ_(λ) term in the energy. Observe that Ψ_(λ) leads to a dilational Cauchy stress as

$\begin{matrix} {{\sigma_{\lambda} = {\frac{1}{J}\left( {\frac{\partial\Psi_{\lambda}}{\partial J_{E}}\frac{\partial J_{E}}{\partial F_{E}}} \right)}}{F_{E}^{T} = {\frac{1}{J}\frac{\partial\Psi_{\lambda}}{\partial J_{E}}}}{{{J_{E}F_{E}^{- T}F_{E}^{T}} = {{- p}\; I}},}} & (2) \end{matrix}$ where

$p = {{{- \frac{1}{J_{P}}}\frac{\partial\Psi_{\lambda}}{\partial J_{E}}} = {{- \frac{1}{J_{P}}}{\lambda\left( {J_{E} - 1} \right)}}}$ is introduced for convenience. Although λ is very large for nearly incompressible materials, deviation from incompressibility will be small so λ(J_(E)−1) will be finite. Rather than computing p directly, p may instead be treated as a separate variable, which facilitates the transition to a fully incompressible material. This can be achieved via the following evolution:

$\begin{matrix} {\frac{Dp}{Dt} = {{- \frac{1}{J_{P}}}\frac{\partial^{2}\Psi_{\lambda}}{{\partial J_{E}}{\partial J_{E}}}{\frac{{DJ}_{E}}{Dt}.}}} & (3) \end{matrix}$ Further, since

${J = {{J_{E}J_{P}\mspace{14mu}{and}\mspace{14mu}\frac{DJ}{Dt}} = {J{\nabla{\cdot v}}}}},{\frac{{DJ}_{E}}{Dt} = {J_{E}{\nabla{\cdot {v.}}}}}$ Accordingly,

$\begin{matrix} {\frac{Dp}{Dt} = {{{- \frac{1}{J_{P}}}\frac{\partial^{2}\Psi_{\lambda}}{{\partial J_{E}}{\partial J_{E}}}J_{E}{\nabla{\cdot v}}} = {{- \frac{\lambda\; J_{E}}{J_{P}}}{\nabla{\cdot {v.}}}}}} & (4) \end{matrix}$ With this definition of p, the force balance equation takes the fluid-like form

$\begin{matrix} {{{\rho\frac{Dv}{Dt}} = {{{\nabla{\cdot \sigma}} + {\rho\; g}} = {{\nabla{\cdot \sigma_{\mu}}} - {\nabla p} + {pg}}}},} & (5) \end{matrix}$ where σ_(μ) the component of stress from Ψ_(μ). The pressure equations may then be discretized in time as

$\begin{matrix} {\frac{p^{n + 1} - p^{n}}{\Delta\; t} = {\frac{\lambda^{n}J_{E}^{n}}{J_{P}^{n}}{\nabla{\cdot {v^{n + 1}.}}}}} & (6) \end{matrix}$ For the velocity equation, the following discretization may be used:

$\begin{matrix} {\frac{v^{n + 1} - v^{n}}{\Delta\; t} = {{{- \frac{1}{\rho^{n}}}\;{\nabla{\cdot \sigma_{\mu}}}} - {\frac{1}{\rho^{n}}{\nabla p^{n + 1}}} + {g.}}} & (7) \end{matrix}$ Note that in equations (6) and (7), the material derivative can be replaced with a simple finite difference in time because advection is performed in a Lagrangian manner using MPM.

The pressure application may also be split from other forces by introducing an intermediate ν*

$\begin{matrix} {{\frac{v^{*} - v^{n}}{\Delta\; t} = {{\frac{1}{\rho^{n}}{\nabla{\cdot \sigma_{\mu}}}} + g}},{\frac{v^{n + 1} - v^{*}}{\Delta\; t} = {{- \frac{1}{\rho^{n}}}{{\nabla p^{n + 1}}.}}}} & (8) \end{matrix}$ Taking the divergence of the second equation and eliminating ∇·ν^(n+1) using the pressure equation yields

$\begin{matrix} {{{\frac{J_{P}^{n}}{\lambda^{n}J_{E}^{n}}\frac{p^{n + 1}}{\Delta\; t}} - {\Delta\; t{\nabla{\cdot \left( {\frac{1}{\rho^{n}}{\nabla p^{n + 1}}} \right)}}}} = {{\frac{J_{P}^{n}}{\lambda^{n}J_{E}^{n}}\frac{p^{n}}{\Delta\; t}} - {\nabla{\cdot {v^{*}.}}}}} & (9) \end{matrix}$ Here,

$p^{n} = {{- \frac{1}{J_{P}^{n}}}{\lambda^{n}\left( {J_{E}^{n} - 1} \right)}}$ may be used for the right-hand side of equation (9).

Note that the discrete system for the pressure will be symmetric positive definite and similar to a discrete heat equation for moderate λ. As λ is increased to the incompressible limit, the pressure equation is then the Poisson equation seen in Chorin-style projections. While the introduction of an auxiliary pressure unknown is common in incompressible elasticity, it would generally be coupled with velocity unknowns. By contrast, the implicit treatment discussed above based on the evolution equation (2) decouples the pressure from the nonlinear equations for velocity unknowns and thereby improves efficiency.

In parallel to the mechanical evolution of 110-140, the simulation application also computes a thermodynamic evolution using the MAC grid as a scratchpad. Although shown as being in parallel, the mechanical evolution may be computed after the mechanical evolution or vice versa, etc., for each time step, as discussed in greater detail below. As shown, the simulation application rasterizes the initial MPM particles to the grid at 145 to obtain initial cell-centered temperature and heat 150. Then, at 155, the simulation application performs a cell-centered Poisson heat-solve to obtain final cell-centered temperature and heat 160, which are interpolated and used to update the phase of the material at 165. Heat flow is given by

$\begin{matrix} {{{\rho\;\frac{Du}{Dt}} = {{- \nabla} \cdot q}},{q = {{- \kappa}\;{\nabla T}}},{c = \frac{\mathbb{d}u}{\mathbb{d}T}},} & (10) \end{matrix}$ where u is stored heat energy per unit mass, T is temperature, q is heat flux, κ is heat conductivity in accordance with Fourier's Law, and c is heat capacity per unit mass. Eliminating u and q leads to the heat equation

$\begin{matrix} {{\rho\; c\;\frac{DT}{Dt}} = {\nabla{\cdot {\left( {\kappa\;{\nabla T}} \right).}}}} & (11) \end{matrix}$ This is a simplified model in which it is assumed that no transfer between mechanical energy and heat energy of the system occurs (and hence u is a function of T only). Additionally, instead of representing volumetric heat source terms, boundary heat conditions are used herein. Note, the complete physical model according to a configuration is a thermo-mechanical model that brings together the mechanical and heat systems discussed above. This may be accomplished by varying, with temperature and phase, the elasto-plastic potential energy density Ψ in equation (1). In one configuration, different expressions for Ψ are used depending on whether the material is in a solid or liquid state, as discussed in greater detail below.

The heat equation (11) may be used to discretize the temperature evolution in time as

$\begin{matrix} {{T^{n + 1} - T^{n}} = {\frac{\Delta\; t}{\rho^{n}c^{n}}{\nabla{\cdot {\left( {\kappa^{n}{\nabla T^{n + 1}}} \right).}}}}} & (12) \end{matrix}$ That is, the temperature at time n+1 may be determined from the temperature at time n using equation (12). Phase transition is a separate process in the sense that it requires extra heat, called latent heat, which cannot be observed as a temperature change. Specifically, latent heat of fusion L is required to transfer a material from solid into liquid state isothermally at the freezing point of the material. In one configuration, latent heat may be modeled using a buffer which stores an amount of heat from 0 to L, with the material phase being changed when the buffer becomes full or empty, as discussed in greater detail below. At 165, the simulation application interpolates the temperature and updates the phase of particles, which in conjunction with the interpolated velocities and updated deformation gradients at 140 produces the final MPM particles 170 for the given time step.

FIG. 2 illustrates a detailed flowchart of a method 200 for simulating varied materials, according to an aspect of this disclosure. As shown, the method 200 begins at step 205, where the simulation application applies a plasticity calculated at a previous timestep. For simplicity, it is common to apply a heuristic plastic-yield criterion for compressible elastic materials, as there is considerable leeway in visual applications. However, in the case of nearly incompressible materials, the plastic flow should also be nearly incompressible. The simulation application may use a simple procedure to guarantee J_(P)≡det(F_(P))=1 for nearly incompressible materials. Specifically, the simulation application may begin by adjusting F_(E) and F_(P) so that the singular values of F_(E) are restricted to the interval [1−θ_(c),1+θ_(s)] as in patent application Ser. No. 14/257,044. Then, the simulation application may apply the correction F_(E)←(J_(P))^(−1/d)F_(E) and F_(P)←(J_(P))^(−1/d)F_(P), which ensures that F_(P) is purely deviatoric, or equivalently, that J_(P)=1.

At step 210, the simulation application computes interpolation weights. In order to transfer data from particles to MAC and MAC cell centers, multiple sets of interpolation weights are needed. Considering the MAC faces for each dimension as a regular cell-centered Cartesian grid, the simulation application may compute interpolating weights for d+1 grids based at (x_(0a),y_(0a),z_(0a)), where a∈{x,y,z} indicate velocity components, and a=* represents the pressure grid. The cell-centered origins for the respective grids are

${\left( {x_{0x},y_{0x},z_{0x}} \right) = \left( {{- \frac{h}{2}},0,0} \right)},{\left( {x_{0y},y_{0y},z_{0y}} \right) = \left( {0,{- \frac{h}{2}},0} \right)},{\left( {x_{0z},y_{0z},z_{0z}} \right) = \left( {0,0,{- \frac{h}{2}}} \right)},{{{and}\mspace{14mu}\left( {x_{0*},y_{0*},z_{0*}} \right)} = \left( {0,0,0} \right)},$ where h is the grid spacing. Thus, the grids are offset with respect to one another, but the weights for each are computed in the same way. Given a grid of spacing h with cell indices c=(i,j,k) with centers located at x_(ca)=(x_(i),y_(j),z_(k))=(x_(0a)+ih,y_(0a)+jh,z_(0a)+kh), interpolation can be defined for arbitrary x_(p)=(x_(p),y_(p),z_(p)). A multidimensional separable kernel can be defined from the one-dimensional cubic B-spline

$\begin{matrix} {{N(x)} = \left\{ {\begin{matrix} {{{\frac{1}{2}{x}^{3}} - x^{2} + \frac{2}{3}},} & {0 \leq {x} < 1} \\ {{{{- \frac{1}{6}}{x}^{3}} + x^{2} - {2{x}} + \frac{4}{3}},} & {1 \leq {x} < 2} \\ {0,} & {otherwise} \end{matrix},} \right.} & (13) \end{matrix}$ as

${N_{ca}^{h}\left( x_{p} \right)} = {{N\left( {\frac{1}{h}\left( {x_{p} - x_{ia}} \right)} \right)}{N\left( {\frac{1}{h}\left( {y_{p} - y_{ja}} \right)} \right)}{{N\left( {\frac{1}{h}\left( {z_{p} - z_{ka}} \right)} \right)}.}}$

In the more compact notation used herein, i is an index into MAC grid faces, and c is an index for cell-centered quantities. For example, ν_(i) stands for the velocity field component at face i, and p_(c) is the pressure value at the center of c. With this notation, the interpolation of particle x_(p) is w_(ip)=N_(c(i)a(i)) ^(h)(x_(p)) with respect to face i and w_(cp)=N_(c*) ^(h)(x_(p)) with respect to cell c. Here, a(i) and c(i) are the dimension component and cell index associated with face i, respectively. Alternatively, the face index can be uniquely identified by a cell and an axis as i=i(c,a), for a∈{x,y,z}. Similarly, the change in the interpolation of particle x_(p) with respect to face i and with respect to cell c may be defined as ∇w_(ip)=∇N_(c(i)a(i)) ^(h)(x_(p)) and ∇w_(cp)=∇N_(c*) ^(h)(x_(p)). The various components and their associated values are summarized in Table 2.

TABLE 2 Grid a Base Weight cell * (0, 0, 0) w_(cp) = N_(c*) ^(h)(x_(p)) x-offset x $\left( {{- \frac{h}{2}},0,0} \right)$ w_(i(c,x)p) = N_(cx) ^(h)(x_(p)) y-offset y $\left( {0,{- \frac{h}{2}},0} \right)$ w_(i(c,y)p) = N_(cy) ^(h)(x_(p)) z-offset z $\left( {0,0,{- \frac{h}{2}},} \right)$ w_(i(c,z)p) = N_(cz) ^(h)(x_(p))

At step 215, the simulation application rasterizes particle data to a grid. The simulation application rasterizes data to the grid using the interpolation weights discussed above with respect to step 214. In one configuration, mass is first rasterized to the grid faces as m_(i) ^(n)=Σ_(p)w_(ip) ^(n)m_(p). These face densities allow the normalization of the interpolation of velocity and thermal conductivity as

$v_{i}^{n} = {{\frac{1}{m_{i}^{n}}{\sum_{p}{w_{ip}^{n}m_{p}v_{i}^{n}\mspace{14mu}{and}\mspace{14mu}\kappa_{i}^{n}}}} = {\frac{1}{m_{i}^{n}}{\sum_{p}{w_{ip}^{n}m_{p}{\kappa_{p}.}}}}}$ This process may be repeated at cell centers, first with cell masses m_(c) ^(n)=Σ_(p)w_(cp) ^(p)m_(p), then followed by

${J_{c}^{n} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}J_{p}^{n}}}}},{c_{c}^{n} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}c_{p}}}}},{J_{Ec}^{n} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}{J_{Ep}^{n}\left( {{{then}\mspace{14mu} J_{Pc}^{n}} = \frac{J_{c}^{n}}{J_{Ec}^{n}}} \right)}}}}},{{{and}\mspace{14mu} T_{c}^{n}} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}{T_{p}^{n}.}}}}}$ Note that

$\frac{1}{\lambda_{c\;}^{n}} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}\lambda_{p}^{- 1}}}}$ is rasterized rather than

$\lambda_{c}^{n} = {\frac{1}{m_{c}^{n}}{\sum_{p}{w_{cp}^{n}m_{p}{\lambda_{p}.}}}}$ This more accurately resolves the pressure

$\frac{- \lambda_{c}^{n}}{J_{Pc}^{n}}\left( {J_{Ec}^{n} - 1} \right)$ under large variation of λ. Experience has shown that failure rasterize as

$\lambda_{c}^{n} = {\frac{1}{m_{c}^{n}}\Sigma_{p}w_{cp}^{n}m_{p}\lambda_{p}}$ causes some instability.

At step 220, the simulation application classifies cells. In one configuration, collision objects may be represented as level sets, and the simulation application may assign each collision object a temperature. In such a case, the simulation application may begin the collision process by checking all faces for collisions. A MAC face is colliding if the level set computed by any collision object is negative at the face center. If the face is colliding, the simulation application flags the face as such. For convenience and consistency, each MAC cell may simply be classified as empty, colliding, or interior. A cell may be marked as colliding if all of its surrounding faces are colliding. A cell may be marked as interior if the cell and all of its surrounding faces have mass. All remaining cells may be marked as empty. Further, for colliding cells, the simulation application may assign either the temperature of the object the cell collides with or a user-defined spatially-varying value depending on the setup. If the free surface is being enforced as a Dirichlet temperature condition, the ambient air temperature may be recorded for empty cells. Other cells may not require temperatures to be recorded at this stage.

At step 225, the simulation application computes material point method forces. In the deviator/dilational splitting of the material response, discussed above, the deviatoric forces are discretized with implicit MPM, and the dilation part is discretized with the generalized Chorin-style projection. Using the common notation from a projection method, the implicit MPM step can be considered as updating the rasterized grid based velocities ν_(i) ^(n) to ν_(i)*. To obtain grid velocities, the simulation application may then apply the pressure correction to ν_(i)* to obtain ν_(i) ^(n+1). The first step for computing ν_(i)* itself is to compute the MPM force.

Following the approach of patent application Ser. No. 14/257,044, the deviatoric forces may be discretized via a potential energy. This naturally facilitates an implicit treatment with symmetric linearization. Let the location of grid face i be denoted as x_(i). If the Eulerian MAC grid is interpreted as though it were Lagrangian, then after time Δt, the face would have moved to {circumflex over (x)}_(i)=x_(i)+Δtν_(i)*e_(a(i)), where e_(a(i)) is the basis vector in the direction corresponding to the MAC velocity component ν_(i)*. Let the vector of all {circumflex over (x)}_(i) be denoted by {circumflex over (x)}. Such a vector can be considered as depending on the vector of all face velocities ν_(i)* which can be denoted as ν*. In other words, {circumflex over (x)}={circumflex over (x)}(ν*). Note that this interpretation is for convenience in computing forces and force derivatives, as the grid does not actually have to move. Since there is only really one degree of freedom in {circumflex over (x)}_(i), it can be denoted as {circumflex over (x)}_(i)=({circumflex over (x)}_(i))_(a(i)) and {circumflex over (x)}_(i)={circumflex over (x)}_(i)(ν_(i)*)=({circumflex over (x)}_(i))_(a(i))+Δtν_(i)*.

The deviatoric potential energy is then Φ_(μ)({circumflex over (x)})=Σ_(p) V _(p) ⁰{circumflex over (Ψ)}_(μ)({circumflex over (F)} _(Ep)({circumflex over (x)}))  (14) where V_(p) ⁰ is the initial volume occupied by particle p, and {circumflex over (F)}_(Ep) is the elastic part of the deformation gradient of particle p. {circumflex over (F)}_(Ep) depends on {circumflex over (x)} as {circumflex over (F)} _(Ep)({circumflex over (x)})=(I+Σ _(i)({circumflex over (x)} _(i) −x _(i))(∇w _(ip) ^(n))^(T))F _(Ep) ^(n).  (15)

The force component f_(i) at face i is given by

${f_{i} = {{- \frac{\partial\Phi}{\partial{\hat{x}}_{i}}} = {{- \frac{\partial\Phi}{\partial{\hat{F}}_{Ep}}}\frac{\partial{\hat{F}}_{Ep}}{\partial{\hat{x}}_{i}}\frac{\partial x_{i}}{\partial x_{i}}}}},$ or

$\begin{matrix} {{f_{i}\left( \hat{x} \right)} = {{- \Sigma_{p}}V_{p}^{0}e_{a{(i)}}^{T}\frac{\partial\Psi}{\partial F_{E}}\left( {{\hat{F}}_{Ep}\left( \hat{x} \right)} \right)\left( F_{Ep}^{n} \right)^{T}{{\nabla w_{ip}^{n}}.}}} & (16) \end{matrix}$ With these forces, the simulation application computes the right hand side for the MPM treatment

$\begin{matrix} {{b_{i} = {v_{i}^{n} + {\frac{\Delta\; t}{m_{i}}f_{i}} + {\Delta\;{tg}_{i}\Sigma_{p}w_{ip}^{n}}}},} & (17) \end{matrix}$ where g_(i) is the gravity component at face i, and

${f_{i}^{n} = {{- \frac{\partial\Phi_{\mu}}{\partial{\hat{x}}_{i}}}\left( {\hat{x}(0)} \right)}},$ again using the convention that {circumflex over (x)}={circumflex over (x)}(ν*).

At step 235, the simulation application processes grid collisions. Each face marked as colliding during step 220 must have its velocity corrected for the collisions. In one configuration, the simulation application may perform sticking collisions for all of the collisions, so that the simulation application simply assigns the velocity component from the collision body to the corresponding face on the MAC grid.

At step 236, the simulation application applies a semi-implicit material point method update. In one configuration, the simulation application may use one step of Newton's method to solve the implicit system for deviatoric and inertial force balance. This yields the following (mass) symmetric system for ν*

$\begin{matrix} {{{\Sigma_{j}\left( {\delta_{ij} + {\frac{\Delta\; t^{2}}{2m_{i}^{n}}\frac{\partial^{2}\Phi_{\mu}}{{\partial{\hat{x}}_{i}}{\partial{\hat{x}}_{j}}}\left( {\hat{x}(0)} \right)}} \right)}v_{j}^{*}} = {b_{i}.}} & (18) \end{matrix}$ The system is symmetric but potentially indefinite, so the iterative conjugate residual method may be used, as this Krylov method only requires the action of the matrix on an arbitrary increment δu (comprised of scalar MAC face increments δu_(i)). The non-trivial term is from the Hessian and can be expressed as

$\begin{matrix} {{{\left. {{\delta\; f_{i}} = {\Sigma_{j}\frac{\partial^{2}\Phi_{\mu}}{{\partial{\hat{x}}_{i}}{\partial{\hat{x}}_{j}}}\left( {\hat{x}(0)} \right)}} \right)\delta\; u_{j}} = {\Sigma_{p}V_{p}^{0}e_{a{(i)}}^{T}{A_{p}\left( F_{Ep}^{n} \right)}^{T}{\nabla w_{ip}^{n}}}},{where}} & (19) \\ {A_{p} = {\frac{\partial^{2}\Psi_{\mu}}{{\partial F_{E}}{\partial F_{E}}}\left( {F_{E}\left( \hat{x} \right)} \right)\text{:}\mspace{11mu}{\left( {\Sigma_{j}\delta\; u_{j}{e_{a{(i)}}\left( {\nabla w_{jp}^{n}} \right)}^{T}F_{Ep}^{n}} \right).}}} & (20) \end{matrix}$

At step 240, the simulation application projects velocities. In one configuration, equation (9), discussed above, may be discretized to obtain the pressure, and the simulation application may use such a pressure to correct the intermediate velocities ν*. This is a discrete parabolic equation that reduces to a Poisson equation in the incompressible limit of λ→∞. In either case, the discretization reduces to a symmetric positive definite system of equations. In one configuration, the discretization in space may be accomplished using the central-difference stencils naturally defined over the MAC grid. The right hand side of the system would then have entries s_(c) stored at MAC cell centers. The simulation application may compute such s_(c) as

${s_{c} = {{- \frac{J_{Ec}^{n} - 1}{\Delta\;{tJ}_{Ec}^{n}}} - {\Sigma_{i}^{n}G_{ic}v_{i}^{*}}}},$ where G_(ic) are the coefficients of the central-differenced gradient stencil. The corresponding matrix takes the increments δp_(c) and produces the results δr_(c), where

${\delta\; r_{c}} = {{\frac{\delta\; p_{c}J_{Pc}^{n}}{J_{Ec}^{n}\lambda_{c}^{n}\Delta\; t} + {\Delta\; t\;\Sigma_{i}\Sigma_{c^{\prime}}\frac{1}{\rho_{i}^{n}}G_{ic}G_{{ic}^{\prime}}\delta\; p_{c^{\prime}}\mspace{14mu}{and}\mspace{14mu}\rho_{i}^{n}}} = \frac{m_{i}^{n}}{v_{i}^{n}}}$ is the mass density at face i, m_(i) ^(n) is the mass at the face, and V_(i) ^(n) is a control volume around the face whose formulas are as described below. After solving for the pressure, the simulation application applies the pressure correction to the velocities using

$v_{i}^{n + 1} = {v_{i}^{*} - {\Delta\; t\;\Sigma_{c}\frac{1}{\rho_{i}^{n}}G_{ic}{p_{c}.}}}$

The discretization of G_(ic) corresponds to a simple voxelized, central-differenced gradient operator. The simulation application may enforce homogeneous Dirichlet pressure boundary conditions at cells that have been marked as empty and homogenous Neumann boundary conditions at faces adjacent to cells that have been marked as colliding.

Degrees of freedom near collision objects do not have as many neighboring particles as interior degrees of freedom, since part of their influence is covered by a collision object. This effect can cause such faces to appear lighter, which would in turn cause the faces to rise under gravity without careful definition of ρ_(i) ^(n). In one configuration, the simulation application may prevent such phenomena by computing control volumes that accurately represent the portion of the domain associated with a face. In particular, the simulation application may compute V_(i) ^(n)=Σ_(c)∫_(Ω) _(c) χ_(c)N_(c(i)a(i)) ^(h)(x)dx, where Ω_(c) is the interior of MAC cell c and χ_(c)=1 if cell c is marked as interior and χ_(c)=0 otherwise. This is an approximation to ∫_(Ω) _(n) N_(i) ^(h) dx where Ω^(n) is the domain encompassed by the material. This control volume is important for accurately approximating the density near collision objects. Note that the integral described in the formula for V_(i) ^(n) has only a finite number of cases, which the product structure of N_(c(i)a(i)) ^(h)(x) makes relatively easy to tabulate.

At step 245, the simulation application solves the heat equation. In one configuration, the simulation application performs a stabilized Poisson solve to update the temperature in accordance with equation (12). In such a case, the simulation application may begin by setting the right hand side to T_(c) ^(n), which is a cell centered rasterized temperature. The corresponding matrix takes the increments δT_(c) and produces the result

${\delta\; T_{c}} + {\Delta\; t\;\Sigma_{i}^{n}\Sigma_{c^{\prime}}\frac{\Delta\; x^{d}}{m_{c}^{n}c_{c}^{n}}\kappa_{i}^{n}G_{ic}G_{{ic}^{\prime}}\delta\;{T_{c^{\prime}}.}}$ The discretization of G_(ic) corresponds to a simple voxelized, central-differenced gradient operator. The simulation application may enforce Dirichlet temperature boundary conditions at cells that are in contact with fixed temperature bodies (like a heated pan or air) and homogenous Neumann boundary conditions at faces adjacent to cells that can be considered empty or corresponding to insulated objects.

At step 250, the simulation application updates particle states from the grid. Some outermost faces involved in the Chorin-style projection of step 240 do not receive a correction and, as a result, such faces may have outdated velocity values. To prevent errors from uncorrected velocities when transferring information back to the particles, a tighter quadratic stencil, given by the following spline, may be used:

$\begin{matrix} {{N(x)} = \left\{ {\begin{matrix} {{{- x^{2}} + \frac{3}{4}},} & {0 \leq {x} < \frac{1}{2}} \\ {{{{- \frac{1}{2}}x^{2}} - {\frac{3}{2}x} + {9\text{/}8}},} & {1 \leq {x} < {3/2}} \\ {0,} & {otherwise} \end{matrix}.} \right.} & (21) \end{matrix}$ In one configuration, the simulation application interpolates velocities back to particles using FLIP, where the PIC component is computed as ν_(p) ^(PIC)=Σ_(i)ν_(i) ^(n+1)w_(ip) ^(n)e_(a(i)) and the FLIP component as ν_(p) ^(FLIP)=ν_(p) ^(n)+Σ_(i)(ν_(i) ^(n+1)−ν_(i) ^(n))w_(ip) ^(n)e_(a(i)). Given these computations, the velocities are ν_(p) ^(n+1)=αν_(p) ^(FLIP)+(1−α)ν_(p) ^(PIC), where α is the flip fraction. In a particular configuration, an α value of 0.95 may be used.

After interpolating velocities back to the particles, the simulation application updates the elastic part of the deformation gradient of particle F_(Ep). A velocity gradient must be determined for this update, and in one configuration the simulation application may compute the velocity gradient with ν_(p) ^(n+1)=αν_(p) ^(FLIP)+(1−α)ν_(p) ^(PIC). A simple way to update F_(Ep) would then be with the update rule F_(Ep) ^(n+1)=(I+Δt∇ν_(p) ^(n+1))F_(Ep) ^(n). However, experience has shown that this update occasionally leads to J_(Ep) ^(n+1)≤0 if the time step is too large. A compromise F_(Ep) ^(n+1)=R(Δt∇ν_(p) ^(n+1))F_(Ep) ^(n) between this simple rule and the ideal but expensive exponential computation F_(Ep) ^(n+1)=e^(Δt∇ν) ^(p) ^(n+1) F_(Ep) ^(n) may be used instead, where

${R(M)} = {{{I + {M\mspace{14mu}{if}\mspace{14mu}{\det\left( {I + M} \right)}}} > {0\mspace{14mu}{and}\mspace{14mu}{R(M)}}} = {R\left( {\frac{1}{2}M} \right)}^{2}}$ otherwise. Note that this is effectively a truncated version of the computation of the exponential function, and the simulation application may invest just enough time to keep the determinant positive. In practice, the function F_(Ep) ^(n+1)=R(Δt∇ν_(p) ^(n+1))F_(Ep) ^(n) recurses very rarely, and the update is more robust but nearly as efficient as the simple rule. If p is a fluid particle, the simulation application may finish the update of F_(Ep) ^(n+1) by removing its deviatoric component, as discussed above, using F_(Ep) ^(n+1)←(J_(p) ^(n+1))^(1/d)I.

Similarly, temperature may be transferred from grid cell centers to particles as T_(p) ^(n+1)=βT_(P) ^(FLIP)+(1−β)T_(P) ^(PIC), where T_(P) ^(FLIP)=T_(p) ^(n)+Σ_(c)(T_(c) ^(n+1)−T_(c) ^(n))w_(cp), T_(p) ^(PIC)=Σ_(c)T_(c) ^(n) w_(cp), and β is the FLIP ratio (e.g., 0.95 may be used). Note, however, that the presence of non-zero latent heat would not allow the temperature to go through the freezing point in this way, since a portion of the heat the particle gets (or loses) should be spent on the phase change. To account for this latent heat effect, the simulation application may maintain an energy buffer for each particle of size L_(p), with the particle storing the amount of heat U_(p) contained in the buffer, which can vary from 0 to L_(p). Whenever the freezing point is reached, the simulation application multiplies any additional temperature change by c_(p)m_(p) and adds this value to the buffer. Once the buffer is completely full (or empty), i.e., particle heat U_(p) equals L_(p) (or 0), the simulation application then switches the particle phase to fluid (or solid) and continues with the regular temperature update. In one configuration, the phase change happens only when the buffer is completely full or empty. Otherwise, the material retains its phase from the previous timestep, and this sort of hysteresis, as opposed to using a hard threshold on U_(p), allows more stable phase transitions.

At step 255, the simulation application processes particle collisions and updates particle positions. That is, the simulation application completes the time integration by enforcing collisions on the particles. As discussed, sticking collisions may be used with the grid, and, in such a case, the simulation application may also model sticking collisions with the particles as well. In one configuration, the simulation application may register a particle as colliding if a collision body registers a negative level set value at the location of the particle. If this occurs, the particle's velocity is set to the velocity of the collision body at that location. The simulation application then updates the particle positions as x_(p) ^(n+1)=x_(p) ^(n)+Δtν_(p) ^(n+1).

FIG. 3 illustrates an example simulation and rendering of a material undergoing phase change, according to an aspect of this disclosure. As shown, the simulation is of butter melting over a hot frying pan 420. Illustratively, a solid chunk of the butter 410 is exposed to the frying pan 420, which acts as an external heat source to melt the chunk of butter 410 into melted butter 430. 4.2×10⁶ particles, a grid resolution of 128×128×128, and a timestep size of Δt=3×10⁻⁴ seconds were used to simulate the melting butter. The treatment of the physics of phase transitions discussed herein allows the simulation application to maintain sharp, yet stable, interfaces between solid and fluid phases. Further, the augment MPM method discussed above captures many intricate features of the melting process, such as wave-like spread and micro ripples of the fluid phase, as well as the sliding behavior of the solid chunk of butter on top of the fluid. By varying the butter material's parameters such as heat conductivity, heat capacity, and latent heat, the heat flow can be controlled, which is an indirect way to affect the dynamics of melting and freezing.

The rendering of the melting butter simulation may be achieved with meshing solutions, or any other feasible technique. Meshing solutions typically involve rasterizing particles to a grid using some basis function followed by grid smoothing, contouring, and final surface smoothing.

FIG. 4 illustrates a system 400 in which an aspect of this disclosure may be implemented. As shown, the system 400 includes, without limitation, a central processing unit (CPU) 405, a network interface 415 connecting the system to a network 416, an interconnect 417, a memory 420, and storage 430. The system 400 may also include an I/O device interface 410 connecting I/O devices 412 (e.g., keyboard, display and mouse devices) to the system 400.

The CPU 405 retrieves and executes programming instructions stored in the memory 420. Similarly, the CPU 405 stores and retrieves application data residing in the memory 420. The interconnect 417 facilitates transmission, such as of programming instructions and application data, between the CPU 405, I/O device interface 410, storage 430, network interface 415, and memory 420. CPU 405 is included to be representative of a single CPU, multiple CPUs, a single CPU having multiple processing cores, and the like. And the memory 420 is generally included to be representative of a random access memory. The storage 430 may be a disk drive storage device. Although shown as a single unit, the storage 430 may be a combination of fixed and/or removable storage devices, such as magnetic disk drives, flash drives, removable memory cards or optical storage, network attached storage (NAS), or a storage area-network (SAN). Further, system 400 is included to be representative of a physical computing system as well as virtual machine instances hosted on a set of underlying physical computing systems. Further still, although shown as a single computing system, one of ordinary skill in the art will recognized that the components of the system 400 shown in FIG. 4 may be distributed across multiple computing systems connected by a data communications network.

As shown, the memory 420 includes an operating system 421 and a simulation application 422. Illustratively, the operating system 421 may include Linux®. The simulation application 422 is configured to simulate material phenomena and render the simulated phenomena to one or more video frames. In one configuration, the simulation application 422 may use an augmented MPM procedure to simulate the material, and render the simulated material to images or video frames, as discussed above with respect to FIGS. 1-3.

Advantageously, techniques disclosed herein permit simulation and rendering of materials across different states. The inability of traditional MPM to handle arbitrarily incompressible materials such as liquids is overcome by augmenting MPM with a Chorin-style projection technique that enables simulation of arbitrarily incompressible materials. Further, phase transitions and changes in material properties are handled by updating the phase and material properties according to a temperature obtained by solving the heat equation on the MPM grid. Techniques disclosed herein can also handle mixtures of materials with different properties, ranging from compressible to (almost) incompressible and varying stiffness and plasticity parameters.

The preceding description references aspects of the disclosure. However, it should be understood that the disclosure is not limited to specific described aspects. Instead, any combination of the preceding features and elements, whether related to different aspects or not, is contemplated to implement and practice the disclosure. Furthermore, although aspects of the disclosure may achieve advantages over other possible solutions and/or over the prior art, whether or not a particular advantage is achieved by a given aspect is not limiting of the disclosure. Thus, the preceding aspects, features, and advantages are merely illustrative and are not considered elements or limitations of the appended claims except where explicitly recited in a claim(s). Likewise, reference to “the disclosure” shall not be construed as a generalization of any inventive subject matter disclosed herein and shall not be considered to be an element or limitation of the appended claims except where explicitly recited in a claim(s).

Aspects of the present disclosure may be embodied as a system, method or computer program product. Accordingly, aspects of the present disclosure may take the form of an entirely hardware aspect, an entirely software aspect (including firmware, resident software, micro-code, etc.) or an aspect combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present disclosure may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus or device.

The flowchart and block diagrams in the Figures illustrate the architecture, functionality and operation of possible implementations of systems, methods and computer program products according to various aspects of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by special-purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

While the foregoing is directed to aspects of the present disclosure, other and further aspects of the disclosure may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow. 

What is claimed is:
 1. A computer-implemented method for simulating and rendering a material while avoiding material point method locking, comprising: for each of a plurality of time steps of a simulation of the material undergoing a phase transition between two states of the material: transferring states of particles representing the material to a grid, determining intermediate grid velocities using a material point method computation, wherein the material point method computation discretizes deviatoric forces, including shear forces, that affect the material using a deviatoric component of a constitutive model, the constitutive model dictating forces that affect the material and splitting into the deviatoric component and a dilational component, applying a projection over the grid, wherein applying the projection includes solving for pressure and correcting the intermediate grid velocities to projected grid velocities using the pressure, and wherein the projection discretizes dilational forces, including at least one of mean volumetric and spherical forces, that affect the material using the dilational component of the constitutive model, and updating the states of one or more of the particles based on at least the projected grid velocities; and rendering one or more images depicting the material using at least the updated states of the one or more of the particles at the plurality of time steps.
 2. The computer-implemented method of claim 1, wherein: the two states of the material include a solid state and a liquid state; and the constitutive model is chosen based on whether the material is in the solid state or the liquid state.
 3. The computer-implemented method of claim 2, wherein: when the material is in the liquid state, the deviatoric component of the constitutive model is equal to zero; and when the material is in the solid state, the deviatoric component of the constitutive model is not equal to zero.
 4. The computer-implemented method of claim 1, wherein the states of the particles include temperatures and phases of the particles, and wherein the method further comprises, for each of the plurality of time steps: solving a heat equation on the grid to obtain updated temperatures; and updating the temperatures and phases of the particles based on at least the updated temperatures.
 5. The computer-implemented method of claim 4, wherein properties of the material including Young's modulus and Poisson ratio are varied based on at least the temperatures of the particles.
 6. The computer-implemented method of claim 4, further comprising: when a temperature of a given particle is equal to a phase transition temperature, adding a heat value to a buffer unless the buffer has reached a predefined latent heat value associated with the phase transition; and when the buffer has reached the predefined latent heat value, changing a phase of the given particle.
 7. The computer-implemented method of claim 1, wherein the grid is a marker-and-cell (MAC) grid.
 8. The computer-implemented method of claim 7, wherein transferring the states of the particles to the grid includes mass weighted rasterization of properties of the particles at cell centers and faces of the MAC grid.
 9. The computer-implemented method of claim 7, further comprising: flagging faces of cells of the MAC grid as colliding if a level set computed by a collision object is negative at centers of the faces; classifying the cells of the MAC grid as empty, colliding, or interior, wherein a given cell is classified as colliding if faces surrounding the given cell are colliding, wherein a given cell is classified as interior if the given cell and faces surrounding the given cell have mass, and wherein remaining cells that are not colliding or interior are classified as empty; and correcting velocities in the intermediate grid velocities for collisions based on at least the classifications of the cells.
 10. A non-transitory computer-readable storage medium storing a program, which, when executed by a processor performs operations for simulating and rendering a material while avoiding material point method locking, the operations comprising: for each of a plurality of time steps of a simulation of the material undergoing a phase transition between two states of the material: transferring states of particles representing the material to a grid, determining intermediate grid velocities using a material point method computation, wherein the material point method computation discretizes deviatoric forces, including shear forces, that affect the material using a deviatoric component of a constitutive model, the constitutive model dictating forces that affect the material and splitting into the deviatoric component and a dilational component, applying a projection over the grid, wherein applying the projection includes solving for pressure and correcting the intermediate grid velocities to projected grid velocities using the pressure, and wherein the projection discretizes dilational forces, including at least one of mean volumetric and spherical forces, that affect the material using the dilational component of the constitutive model, and updating the states of one or more of the particles based on at least the projected grid velocities; and rendering one or more images depicting the material using at least the updated states of the one or more of the particles at the plurality of time steps.
 11. The computer-readable storage medium of claim 10, wherein: the two states of the material include a solid state and a liquid state; and the constitutive model is chosen based on whether the material is in the solid state or the liquid state.
 12. The computer-readable storage medium of claim 11, wherein: when the material is in the liquid state, the deviatoric component of the constitutive model is equal to zero; and when the material is in the solid state, the deviatoric component of the constitutive model is not equal to zero.
 13. The computer-readable storage medium of claim 10, wherein the states of the particles include temperatures of the particles and phases of the particles, the operations further comprising, for each of the plurality of time steps: solving a heat equation on the grid to obtain updated temperatures; and updating the temperatures and phases of the particles based on at least the updated temperatures.
 14. The computer-readable storage medium of claim 13, wherein properties of the material including Young's modulus and Poisson ratio are varied based at least on the temperatures of the particles.
 15. The computer-readable storage medium of claim 13, the operations further comprising: when a temperature of a given particle is equal to a phase transition temperature, adding a heat value to a buffer unless the buffer has reached a predefined latent heat value associated with the phase transition; and when the buffer has reached the predefined latent heat value, changing a phase of the given particle.
 16. The computer-readable storage medium of claim 10, wherein the grid is a marker-and-cell (MAC) grid, and wherein transferring the states of the particles to the grid includes mass weighted rasterization of properties of the particles at cell centers and faces of the MAC grid.
 17. The computer-readable storage medium of claim 16, the operations further comprising: flagging faces of cells of the MAC grid as colliding if a level set computed by a collision object is negative at centers of the faces; classifying the cells of the MAC grid as empty, colliding, or interior, wherein a given cell is classified as colliding if faces surrounding the given cell are colliding, wherein a given cell is classified as interior if the given cell and faces surrounding the given cell have mass, and wherein remaining cells that are not colliding or interior are classified as empty; and correcting velocities in the intermediate grid velocities for collisions based on at least the classifications of the cells.
 18. A system, comprising: a processor; and a memory, wherein the memory includes an application program configured to perform operations for simulating and rendering a material while avoiding material point method locking, the operations comprising: for each of a plurality of time steps of a simulation of the material undergoing a phase transition between two states of the material: transferring states of particles representing the material to a grid, determining intermediate grid velocities using a material point method computation, wherein the material point method computation discretizes deviatoric forces, including shear forces, that affect the material using a deviatoric component of a constitutive model, the constitutive model dictating forces that affect the material and splitting into the deviatoric component and a dilational component; applying a projection over the grid, wherein applying the projection includes solving for pressure and correcting the intermediate grid velocities to projected grid velocities using the pressure, and wherein the projection discretizes dilational forces, including at least one of mean volumetric and spherical forces, that affect the material using the dilational component of the constitutive model; and updating the states of one or more of the particles based on at least the projected grid velocities, and rendering one or more images depicting the material using at least the updated states of the one or more of the particles at the plurality of time steps. 